package com.csair.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.csair.uplatform.dto.UserDTO;
import com.csair.uplatform.service.GroupMemberService;
@Namespace("/loginUser")
public class LoginUserAction {

	private static Logger log = LoggerFactory.getLogger(LoginUserAction.class);
	private UserDTO user;
	@Autowired
	private GroupMemberService groupMemberService;
	@Action(value="login", results={@Result(name="success", location="contentLogin.jsp")})
	public String login() {
		log.info("hello wolrd");
		log.info(user.toString());
		groupMemberService.saveUser(user);
		return "success";
	}

	public UserDTO getUser() {
		return user;
	}

	public void setUser(UserDTO user) {
		this.user = user;
	}
	
	
}
